{% comment %}
If user can see this page, then they must already have some permissions required by
some views in the sidebar 
{% endcomment %}
{% if perms.user.can_manage_users %}
    <li>
        <details open>
            <summary>
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="tw:size-4">
                    <path fill-rule="evenodd" d="M8.25 6.75a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0ZM15.75 9.75a3 3 0 1 1 6 0 3 3 0 0 1-6 0ZM2.25 9.75a3 3 0 1 1 6 0 3 3 0 0 1-6 0ZM6.31 15.117A6.745 6.745 0 0 1 12 12a6.745 6.745 0 0 1 6.709 7.498.75.75 0 0 1-.372.568A12.696 12.696 0 0 1 12 21.75c-2.305 0-4.47-.612-6.337-1.684a.75.75 0 0 1-.372-.568 6.787 6.787 0 0 1 1.019-4.38Z" clip-rule="evenodd" />
                    <path d="M5.082 14.254a8.287 8.287 0 0 0-1.308 5.135 9.687 9.687 0 0 1-1.764-.44l-.115-.04a.563.563 0 0 1-.373-.487l-.01-.121a3.75 3.75 0 0 1 3.57-4.047ZM20.226 19.389a8.287 8.287 0 0 0-1.308-5.135 3.75 3.75 0 0 1 3.57 4.047l-.01.121a.563.563 0 0 1-.373.486l-.115.04c-.567.2-1.156.349-1.764.441Z" />
                </svg>
                {% trans '用户' %}
            </summary>
            <ul>
                <li><a {% if sidebar_sec == 'user-common' %}class="tw:menu-active"{% endif %} href="{% url 'user:management/list' %}">
                    {% trans '管理' %}
                </a></li>
                <li><a {% if sidebar_sec == 'user-registry' %}class="tw:menu-active"{% endif %} href="{% url 'audit:user' %}">
                    {% trans '注册' %}
                </a></li>
            </ul>
        </details>
    </li>
{% endif %}
{% if perms.user.can_manage_projects %}
    <li>
        <details open>
            <summary>
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="tw:size-4">
                    <path fill-rule="evenodd" d="M1.5 7.125c0-1.036.84-1.875 1.875-1.875h6c1.036 0 1.875.84 1.875 1.875v3.75c0 1.036-.84 1.875-1.875 1.875h-6A1.875 1.875 0 0 1 1.5 10.875v-3.75Zm12 1.5c0-1.036.84-1.875 1.875-1.875h5.25c1.035 0 1.875.84 1.875 1.875v8.25c0 1.035-.84 1.875-1.875 1.875h-5.25a1.875 1.875 0 0 1-1.875-1.875v-8.25ZM3 16.125c0-1.036.84-1.875 1.875-1.875h5.25c1.036 0 1.875.84 1.875 1.875v2.25c0 1.035-.84 1.875-1.875 1.875h-5.25A1.875 1.875 0 0 1 3 18.375v-2.25Z" clip-rule="evenodd" />
                </svg>
                {% trans '项目' %}
            </summary>
            <ul>
                <li><a {% if sidebar_sec == 'project' %}class="tw:menu-active"{% endif %} href="{% url 'project:management/list' %}">{% trans '列表' %}</a></li>
                <li><a {% if sidebar_sec == 'project-audit' %}class="tw:menu-active"{% endif %} href="{% url 'audit:project-info' %}">{% trans '审核' %}</a></li>
            </ul>
        </details>
    </li>
{% endif %}
{% if perms.user.can_manage_resources %}
    <li>
        <details open>
            <summary>
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="tw:size-4">
                    <path d="M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625Z" />
                    <path d="M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z" />
                </svg>
                {% trans '文件' %}
            </summary>
            <ul>
                <li> <a {% if sidebar_sec == 'audit-file-access' %}class="tw:menu-active"{% endif %} href="{% url 'audit:file' %}">{% trans '访问申请审核' %}</a> </li>
            </ul>
        </details>
    </li>
{% endif %}
